<script src="https://unpkg.com/vue"></script>

<div id="app">
  <div v-bind:class="classObject">hello.</div>
</div>

<script>
  var vm = new Vue({
    el: '#app',
    // data: {
    //   classObject: {
    //     active: true,
    //     'text-danger': false
    //   }
    // }
    data: {
      isActive: true,
      error: null
    },
    computed: {
      classObject: function () {
        return {
          active: this.isActive && !this.error,
          'text-danger': this.error && this.error.type === 'fatal',
        }
      }
    }
  });

</script>
<style>
  .active {
    text-decoration: underline;
  }

  .text-danger {
    color: red;
  }

</style>
